package com.xqh.javabasic.input_output_device;
import java.io.FileInputStream;
import java.io.File;
public class ReadIntToFile_MoveBit_BitOr_Arry{
	public static int [] readIntToFile_MoveBit_BitOr_Arry(String file_path)throws Exception{
	
	FileInputStream fis = new FileInputStream(file_path);
	  long file_length = new File(file_path).length();
		 int x0,x1,x2,x3,x;
		 int i = 0;
		 int [] arry = new int [(int)file_length/4];
		 
	while(i < arry.length){
		
		x0 = fis.read();
		x1 = fis.read();
		x2 = fis.read();
		x3 = fis.read();
				
		x0 = x0;
		x1 = (x1 << 1 * 8);
		x2 = (x2 << 2 * 8);
		x3 = (x3 << 3 * 8);
				
		x = x3|x2|x1|x0;
		arry [i] = x;
		i++;
		}
		fis.close();
		return arry;
	}

	public static void main (String [] args) throws Exception{
		
		int [] return_arry = readIntToFile_MoveBit_BitOr_Arry("d:/data1");
	
			System.out.println(return_arry [4]);
	}
}